package com.cms.clash.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cms.clash.entity.HostEntity;
import com.cms.clash.mapper.HostMapper;
import com.cms.clash.service.IHostService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 主机推荐-实现类
 * @author cms
 * @since 2024-07-27
 */
@Service
public class HostService extends ServiceImpl<HostMapper, HostEntity> implements IHostService {
    public List<HostEntity> getHostList(Integer num) {
        LambdaQueryWrapper<HostEntity> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(HostEntity::getIsDel, 0);
        wrapper.last(" limit " + num);
        List<HostEntity> hostEntities = this.baseMapper.selectList(wrapper);
        return hostEntities;
    }
}
